package designpattern.prototype;

import java.io.Serializable;

//玩具
public class Toy implements Serializable,Cloneable {
    private String name;
    private String color;

    public Toy() {
    }

    public Toy(String name, String color) {
        this.name = name;
        this.color = color;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    @Override
    public String toString() {
        return "Toy{" +
                "name='" + name + '\'' +
                ", color='" + color + '\'' +
                '}';
    }

    @Override
    protected Toy clone() throws CloneNotSupportedException {
        return (Toy) super.clone();
    }
}
